﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true"
    CodeFile="ThietLapThuongLuong.aspx.cs" Inherits="ThietLapThuongLuong" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="up1" runat="server">
        <ContentTemplate>
            <div class="panel panel-success margin">
                <div class="panel-heading">
                    <h3 class="panel-title">
                        Thiết lập thưởng lương</h3>
                </div>
                <div class="panel-body">
                    <table width="100%">
                        <tr>
                            <td>
                                Ngày tháng<br />
                                <asp:TextBox runat="server" CssClass="form-control with98" ID="txtngaythang" 
                                   AutoPostBack="true" ontextchanged="txtngaythang_TextChanged">
                                </asp:TextBox>
                                <cc1:CalendarExtender PopupPosition="BottomRight" ID="CalendarExtender1" runat="server"
                                    TargetControlID="txtngaythang" Format="dd/MM/yyyy">
                                </cc1:CalendarExtender>
                                <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender2" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtngaythang" ValidChars="/" />
                            </td>
                            <td>
                                <span style="margin-left: 5px;">Họ tên</span><br />
                                <asp:DropDownList runat="server" CssClass="form-control width98" ID="drhoten" AutoPostBack="true"
                                    DataValueField="IDs" DataTextField="hoten" OnSelectedIndexChanged="drhoten_SelectedIndexChanged">
                                </asp:DropDownList>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator1" runat="server"
                                    ControlToValidate="drhoten" ErrorMessage="Chọn họ tên" Display="None" Text="*"></asp:RequiredFieldValidator>
                            </td>
                            <td>
                                Bố phận<br />
                                <asp:TextBox runat="server" Enabled="false" CssClass="form-control width98" ID="txtbophan">
                                </asp:TextBox>
                            </td>
                            <td>
                                Chức vụ<br />
                                <asp:TextBox runat="server" Enabled="false" CssClass="form-control width98" ID="txtchucvu">
                                </asp:TextBox>
                            </td>
                            <td width="15%">
                                Số tiền<br />
                                <asp:TextBox ID="txtsotien" CssClass="form-control width98" runat="server"></asp:TextBox>
                                <asp:RequiredFieldValidator ValidationGroup="Them" ID="RequiredFieldValidator2" runat="server"
                                    ControlToValidate="txtsotien" ErrorMessage="Chọn số tiền" Display="None" Text="*"></asp:RequiredFieldValidator>
                                     <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender1" runat="server" FilterType="Custom,Numbers"
                                    TargetControlID="txtsotien" ValidChars=",." />
                            </td>
                            <td width="15%">
                                Quyết định số<br />
                                <asp:TextBox ID="txtquyetdinh" CssClass="form-control width98" runat="server"></asp:TextBox>
                            </td>
                            <td>
                                <span style="margin-left: 5px;">
                                    <br />
                                    <asp:CheckBox ID="ckdachi" runat="server" Text="Đã chi" /></span> <span style="margin-left: 5px;">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="7">
                                Nội dung thưởng<br />
                                <asp:TextBox ID="txtnoidung" runat="server" CssClass="form-control width98"></asp:TextBox>
                            </td>
                            <tr>
                                <td colspan="6">
                                    <asp:Button ID="btnSave" runat="server" CssClass="btn btn-primary" OnClick="btnSave_Click"
                                        Style="margin-left: 5px;" Text="Lưu lại" ValidationGroup="Them" />
                                    <asp:Button ID="btncapnhat" runat="server" CssClass="btn btn-info" OnClick="btncapnhat_Click"
                                        Text="Cập nhật" Visible="false" />
                                    <asp:Button ID="btnCancel" runat="server" CssClass="btn btn-warning" OnClick="btnCancel_Click"
                                        Text="Nhập mới" />
                                </td>
                            </tr>
                    </table>
                    <asp:ValidationSummary ID="ValidationSummary1" HeaderText="Bạn phải nhập các trường sau:"
                        ShowMessageBox="true" ValidationGroup="Them" ShowSummary="false" EnableClientScript="true"
                        runat="server" />
                </div>
            </div>
            <div style="margin: 5px;">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        Danh sách thưởng</div>
                    <div style="margin-bottom: 5px;">
                        <asp:DropDownList ID="dlThang" runat="server" Width="150px" AutoPostBack="true" CssClass="form-control"
                            OnSelectedIndexChanged="dlThang_SelectedIndexChanged" >
                        </asp:DropDownList>
                        <asp:DropDownList ID="dlNam" runat="server" Width="110px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:TextBox ID="txtTuNgay" runat="server" placeholder="Từ ngày" Visible="true" Width="100px"
                            CssClass="form-control"></asp:TextBox>&nbsp;
                        <asp:TextBox ID="txtDenNgay" runat="server" placeholder="Đến ngày" AutoPostBack="true"
                            Visible="true" Width="100px" CssClass="form-control"></asp:TextBox>
                        <cc1:CalendarExtender ID="CalendarExtender11" runat="server" TargetControlID="txtTuNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:CalendarExtender ID="CalendarExtender111" runat="server" TargetControlID="txtDenNgay"
                            Format="dd/MM/yyyy">
                        </cc1:CalendarExtender>
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender9" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtTuNgay" ValidChars="/-" />
                        <cc1:FilteredTextBoxExtender ID="FilteredTextBoxExtender10" runat="server" FilterType="Custom,Numbers"
                            TargetControlID="txtDenNgay" ValidChars="/-" />
                        <asp:DropDownList ID="dropNhanVien" DataTextField="hoten" DataValueField="ids" runat="server"
                            Width="140px" CssClass="form-control">
                        </asp:DropDownList>
                        <asp:Button ID="Button2" CssClass="btn btn-primary" runat="server" 
                            Text="Tìm kiếm" onclick="Button2_Click" />
                    </div>
                    <div style="width: 100%; margin-top: 0px;" class="wrapper">
                        <asp:GridView ID="GV" runat="server" AutoGenerateColumns="false" BackColor="White"
                            BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" CellPadding="1" EmptyDataText="Không có dữ liệu nào"
                            EnableModelValidation="True" ShowFooter="false" CssClass="form-control withall"
                            Width="99%" OnRowCommand="GV_RowCommand">
                            <Columns>
                                <asp:TemplateField HeaderText="Xóa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbXoa" runat="server" Width="20px" Height="20px" ImageUrl="~/img/delete-24.png"
                                            OnClientClick="return confirm('Bạn chắc chắn muốn xóa ?')" CommandArgument='<%#Eval("IDs")%>'
                                            Text="Xóa" CommandName="Del" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:TemplateField HeaderText="Sửa" ItemStyle-HorizontalAlign="Center" HeaderStyle-Width="50px"
                                    ItemStyle-Width="50px">
                                    <ItemTemplate>
                                        <asp:ImageButton ID="lbSua" runat="server" Width="15px" Height="15px" ImageUrl="~/img/edit.ico"
                                            CommandArgument='<%#Eval("IDs")%>' Text="Sửa" CommandName="Select" />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="ngaythang" ItemStyle-CssClass="padding" HeaderText="Ngày tháng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="hoten" ItemStyle-CssClass="padding" HeaderText="Họ tên"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="tenchucvu" ItemStyle-CssClass="padding" HeaderText="Tên chức vụ"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="tenbophan" ItemStyle-CssClass="padding" HeaderText="Tên bộ phận"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="noidung" ItemStyle-CssClass="padding" HeaderText="Nội dung thưởng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="sotien" ItemStyle-CssClass="padding" HeaderText="Số tiền thưởng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="quyetdinh" ItemStyle-CssClass="padding" HeaderText="Số quyết định thưởng"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                                <asp:BoundField DataField="dachi" ItemStyle-CssClass="padding" HeaderText="Đã chi"
                                    HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Left" />
                            </Columns>
                            <FooterStyle BackColor="White" ForeColor="#000066" Font-Bold="True" HorizontalAlign="Left" />
                            <HeaderStyle BackColor="White" Font-Bold="True" ForeColor="Black" Height="30px" />
                            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                            <RowStyle BackColor="White" ForeColor="#000066" Height="30px" />
                            <SelectedRowStyle BackColor="Lavender" Font-Bold="false" />
                        </asp:GridView>
                        <div style="margin: 5px;">
                            <asp:Button ID="btnFirst" runat="server" Text="Đầu" CssClass="btn btn-primary" OnClick="btnFirst_Click" />
                            <asp:Button ID="btnPre" runat="server" Style="margin-left: 5px;" Text="Trước" CssClass="btn btn-primary"
                                OnClick="btnPre_Click" />
                            <asp:Button ID="btnNext" runat="server" Style="margin-left: 5px;" Text="Sau" CssClass="btn btn-warning"
                                OnClick="btnNext_Click" />
                        </div>
                    </div>
                </div>
                <asp:HiddenField ID="hdID" runat="server" />
                <asp:HiddenField ID="HiddenField1" runat="server" />
                <asp:HiddenField ID="HiddenField2" runat="server" />
                <asp:HiddenField ID="hdTuNgay" runat="server" />
                <asp:HiddenField ID="hdDenNgay" runat="server" />
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
